import React, { Component } from "react";

class DefaultPropsDemo extends Component {
  state = {};
  render() {
    return (
      <div>
        {/* 2.0 在调用PageSize的时候不传入pageSize属性值，则取默认值 */}
        <PageSize></PageSize>
      </div>
    );
  }
}

export default DefaultPropsDemo;

class PageSize extends Component {
  state = {};
  render() {
    return <div>{this.props.pageSize}</div>;
  }
}

// 1.0 设定PageSize组价的props中的pageSize的默认值为10
PageSize.defaultProps = {
  pageSize: 10,
};
